﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Default3 : System.Web.UI.Page, System.Web.UI.ICallbackEventHandler
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string script = Page.ClientScript.GetCallbackEventReference(this, "BeforPost()", "CallBack", "");
        Page.ClientScript.RegisterClientScriptBlock(this.GetType(), 
            "CallServer",
            "function CallServer(){" + script + ";}", 
            true);
    }

    string result = string.Empty;
    #region ICallbackEventHandler Members
    public string GetCallbackResult()
    {
        return result;
    }

    public void RaiseCallbackEvent(string eventArgument)
    {
        result = "from server:" + eventArgument;
    }
    #endregion
}
